#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <myCommon.h>


extern void * xmalloc(int size)
{
	void *ret = NULL;
	while ( !ret)
		ret = malloc(size);
	return ret;
}


extern char * xstrcat(const char *source1, const char *source2)
{
	if (source1 == NULL || source2 == NULL) {
		fprintf(stderr, "xstrcat's argument can't be null.");
		exit(1);
	}
	char *ret = xmalloc(strlen(source1) + strlen(source2) + 1);
	sprintf(ret, "%s%s", source1, source2);
	return ret;
}
